Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

365
Views
"cannot find -lucontext" when installing some rubygems on newly pushed docker image ruby:2.7.4-alpine3.13

I can no longer install the Rubygems byebug and racc on the ruby:2.7.4-alpine3.13 image that was pushed in the last day. It seems something has been removed or moved.

To reproduce:

docker pull ruby:2.7.4-alpine3.13
2.7.4-alpine3.13: Pulling from library/ruby
Digest: sha256:89b589e1b6b334ed7af93da3d4c75dca5beef8f1a844594c3a865bc6c4f5b96e
Status: Image is up to date for ruby:2.7.4-alpine3.13

docker run --rm -it --entrypoint /bin/sh ruby@sha256:89b589e1b6b334ed7af93da3d4c75dca5beef8f1a844594c3a865bc6c4f5b96e
apk --no-cache add "build-base>=0.5"
gem install byebug

gives me:

Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.

Following the logs down, I get:

current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.7.0 -r ./siteconf20211027-12-7c6k46.rb extconf.rb
creating Makefile

current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
make "DESTDIR=" clean

current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
compiling locker.c
compiling threads.c
linking shared-object byebug/byebug.so
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lucontext
collect2: error: ld returned 1 exit status
make: *** [Makefile:262: byebug.so] Error 1

Looking for the header files we get:

find . -name ucontext.h
./usr/include/asm/ucontext.h
./usr/include/asm-generic/ucontext.h
./usr/include/sys/ucontext.h
./usr/include/ucontext.h

Installation of the byebug gem works using the digest to define the image that ruby:2.7.4-alpine3.13 used to be on 19 October 2021 (ruby@sha256:ace3785b1a5eb95d08285f8741e3dc1c481c479a271d54e37b8e45a7106d86c6) but the image was updated in the last day, and something has changed in it.

When I run find . -name ucontext.h on the working image, the files are in the same location.

Anyone have any thoughts on how to get this working?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I ran into the same issue. Seems like it was caused by this commit I manually added the libucontext-dev Alpine package and included the command export LIBS='-lucontext' to my Dockerfile and my build started working again.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!